Method for testing a browser-based application

ABSTRACT

A method for testing multiple language versions of a browser-based application. A host language Hypertext Transfer Protocol (HTTP) request issued by a host language browser is received. The host language HTTP request is configured to be sent to a host server address. The host language HTTP request comprises parameter strings in a host language. A target language HTTP request is generated by replacing each host parameter string of at least one host parameter string of the parameter strings in the received HTTP request with a respective target parameter string associated with a target language that differs from the host language. The generated target language HTTP request is configured to be sent to a target server address associated with and different from the host server address.

TECHNICAL FIELD

The present invention relates generally to the testing of an applicationand more particularly, to a method and system for testing abrowser-based application.

BACKGROUND

With the development of Web technology currently, many Web applicationsare implemented based on the browser/server (B/S) architecture.Different from the conventional client/server (C/S) architecture, theB/S architecture only requires a browser and does not need to installspecialized software. It is convenient to work on different platforms byinteracting with the Web server through the browser. In order to beadapted to the Internet environment, currently many Web applicationshave different language versions. Currently, there is not a simple andquick method for international testing of Web application products; andif a conventional software testing method is used, with the increase ofsupported languages, the workload of testing will also increasesexponentially. Therefore, there is a need for a method for quickly andefficiently performing international testing of a Web applicationproduct.

BRIEF SUMMARY

The present invention provides a method for testing multiple languageversions of a browser-based application, said method comprising:

a processor of a computer system receiving a host language HypertextTransfer Protocol (HTTP) request issued by a host language browser, saidhost language HTTP request configured to be sent to a host serveraddress, said HTTP request comprising a plurality of parameter stringsin a host language; and

said processor generating a target language HTTP request by replacingeach host parameter string of at least one host parameter string of theplurality of parameter strings in the received HTTP request with arespective target parameter string associated with a target languagethat differs from the host language, said generated target language HTTPrequest configured to be sent to a target server address associated withand different from the host server address.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a block diagram of an exemplary computing system suitablefor realizing implementations of the present invention.

FIG. 2 shows a flow chart of method for testing a browser-basedapplication according to an embodiment of the present invention.

FIG. 3 shows a block diagram of a system for testing a browser-basedapplication according to an embodiment of the present invention.

DETAILED DESCRIPTION

The present invention provides a method for testing a browser-basedapplication, comprising: receiving a host language Hypertext TransferProtocol (HTTP) request issued by a host language browser; obtainingglobalization rules; modifying the host language HTTP request accordingto the globalization rules to generate a target language HTTP request;and instructing a target language browser to issue the generated targetlanguage HTTP request. In the above one or more embodiments provided byembodiments of the present invention, by modifying a host language HTTPrequest using globalization rules to generate a target language HTTPrequest and further instructing to issue the generated target languageHTTP request, multiple language versions of the Web application can betested concurrently, so as to greatly increase the testing efficiency,and enable fast and efficient international testing of the Webapplication product.

With the present invention, virtualization technology can be utilized toinstall web application servers of different languages on a plurality ofvirtual machines, to perform testing of multiple language versions of aWeb application concurrently, so as to significantly increase thetesting efficiency.

According to an embodiment of the present invention, there is provided amethod for testing a browser-based application, comprising: receiving ahost language HTTP request issued by a host language browser; obtainingglobalization rules; modifying the host language HTTP request accordingto the globalization rules to generate a target language HTTP request;and instructing the target language browser to issue the generatedtarget language HTTP request.

According to an embodiment of the present invention, a system fortesting a browser-based application is provided, comprising: a requestreceiver configured to receive a host language HTTP request issued by ahost language browser; a rule obtainer configured to obtainglobalization rules; a request modifier configured to modify the hostlanguage HTTP request according to the globalization rules to generate atarget language HTTP request; and a request instructor configured toinstruct the target language browser to issue the generated targetlanguage HTTP request.

In addition, an embodiment of the present invention also provides acomputer program product corresponding to the above method.

In the above one or more embodiments provided by the embodiments of thepresent invention, by using globalization rules to modify a hostlanguage HTTP request to generate a target language HTTP request andfurther instruct to issue the generated the target language HTTPrequest, concurrent testing can be performed on multiple languagesversions of the Web application, so as to greatly increase the testingefficiency and to enable fast and efficient international testing of theWeb application product.

In the following description of the present invention, exemplaryembodiments of the present disclosure are described in conjunction withthe accompanying drawings. For clarity and simplicity, not all thefeatures of actual implementations are described in the description.However, it should be appreciated that many decisions specific to theactual implementations must be made during developing the actualembodiments, so as to realize specific objectives; e.g., complying withthe constraints related to the system and business, which constraintsmay vary with different implementations.

FIG. 1 shows a block diagram of an exemplary computer system 100suitable for realizing implementations of the present invention. Asshown in FIG. 1, the computer system 100 may include: a CPU (centralprocessing unit) 101, a RAM (random access memory) 102, a ROM (read onlymemory) 103, a system bus 104, a hard disk controller 105, a keyboardcontroller 106, a serial interface controller 107, a parallel interfacecontroller 108, a display controller 109, a hard disk 110, a keyboard111, a serial peripheral device 112, a parallel peripheral device 114and a display 114. In these devices, what are coupled with the systembus 104 are the CPU 101, the RAM 102, the ROM 103, the hard diskcontroller 105, the keyboard controller 106, the serial controller 107,the parallel controller 108 and the display controller 109. The harddisk 110 is coupled with the hard disk controller 105, the keyboard 111is coupled with the keyboard controller 106, the serial peripheraldevice 12 is coupled with the serial interface controller 107, theparallel peripheral device 113 is coupled with the parallel interfacecontroller 108, and the display 114 is coupled with the displaycontroller 109.

Thus, the computer system 100 invention may comprise a processor (e.g.,CPU 101), a memory (e.g., RAM 102) coupled to the processor, and acomputer readable storage device (e.g., hard disk 110 in FIG. 1, floppydisk, removable media, flash memory, a “memory stick”, optical media,magneto-optical media, CD-ROM, etc.) coupled to the processor. Thestorage device contains program code configured to be executed by theprocessor via the memory to implement the methods of the presentinvention.

In one embodiment, the present invention may take the form of a computerprogram product comprising one or more physically tangible (e.g.,hardware) computer readable storage medium(s) or devices having computerreadable program code stored therein. The program code is configured tobe executed by a processor of a computer system to implement the methodsof the present invention. In one embodiment, the physically tangiblecomputer readable medium(s) and/or device(s) (e.g., hardware mediaand/or devices) that store the program code which implement methods ofthe present invention do not comprise a signal generally, or atransitory signal in particular.

It should be appreciated that the structural block diagram of FIG. 1 isshown only for illustrative purpose, rather than limitation to the scopeof the present invention. In some cases, some devices may be added orremoved according to specific conditions.

FIG. 2 shows a flowchart of a method 200 for testing a browser-basedapplication according to an embodiment of the present invention. Asshown in FIG. 2, the method 200 for testing a browser-based applicationstarts at step 202.

Next, the method 200 enters into step 204, in which a host language HTTPrequest issued by the host language browser is received. The hostlanguage HTTP request is configured to be sent to a host server addressand the HTTP request comprises a plurality of parameter strings in ahost language. The host language HTTP request is an HTTP request issuedby the tester performing the globalization testing through the hostlanguage browser he/she operates. The host language browser can have,e.g., English interface, that is, the host language is English. The hostlanguage browser operated by the tester receives a user input andgenerates a host language HTTP request. The following gives an exampleof a generated host language HTTP request.

GET /SampleWeb/javax.faces.resource/sample.jsf?Stringname=Create+User&Date=07%2D01 %2D2011 HTTP/1.1 Accept-Language: en-us User-Agent:Mozilla/4.0 Host: 9.125.139.100 Connection: Keep-Alive

Next, the method 200 enters into step 206, in which globalization rulesare obtained. The globalization rules specify rules of correspondencebetween different language versions of a browser-based application.Table 1 presents an example of the globalization rules. It should beunderstood that Table 1 only exemplarily shows part of the rules, andthe rules shown in Table 1 are only exemplary illustration, and shouldnot be taken as limitation to the technical solutions of the presentdisclosure. For different applications, the globalization rules may havedifferent specific rules or forms.

TABLE 1 Language en-us zh-cn Date format mm-dd-yyyy yyyy 

 mm 

 dd 

Server address 9.125.139.100 9.125.139.200 String name Create User

String name Network

Thus in one embodiment, globalization rules of correspondence betweenhost parameter strings in the host language and corresponding targetparameter strings associated with the target language are obtained. Inthe globalization rules, each host parameter string of the at least onehost parameter string in the host language HTTP request is found. Thenthe respective target parameter string corresponding to each hostparameter string found in the globalization rules is determined.

In one embodiment as depicted in the Language row in Table 1, a hostlanguage parameter string of the at least one host parameter string inthe host language HTTP request may be the host language (e.g., en-usdenoting English as depicted in Table 1), wherein the globalizationrules specify that the target language (e.g., zh-cn denoting Chinese asdepicted in Table 1) is the respective target parameter stringcorresponding to the host language parameter string.

In one embodiment as depicted in the server address row in Table 1, ahost address parameter string of the at least one host parameter stringin the host language HTTP request is the host server address, whereinthe globalization rules specify that the target server address is therespective target parameter string corresponding to the host addressparameter string.

In one embodiment as depicted in the date format row in Table 1, a dateformat parameter string of the at least one host parameter string in thehost language HTTP request specifies a format for a month, day, and yearof a date.

Next, method 200 enters into step 208, in which the host language HTTPrequest is modified according to the globalization rules to generate atarget language HTTP request. In one embodiment, each host parameterstring of the at least one host parameter string in the host languageHTTP request is replaced with the respective target parameter stringdetermined from the globalization rules.

According to an embodiment of the present invention, a host parameterstring is extracted from the received host language HTTP request andreplaced by a corresponding target parameter string. In one embodiment,the target language HTTP request is generated by replacing each hostparameter string of at least one host parameter string of a plurality ofparameter strings in the received HTTP request with a respective targetparameter string associated with a target language that differs from thehost language. The generated target language HTTP request is configuredto be sent to a target server address associated with and different fromthe host server address.

According to an embodiment of the present invention, modifying the hostlanguage HTTP according to the globalization rules to generate a targetlanguage HTTP request comprises: searching for a corresponding parameterstring in the target language, and replacing the parameter string in thehost language HTTP request with the corresponding parameter string inthe target language. According to an embodiment of the presentdisclosure, modifying the host language HTTP according to theglobalization rules to generate a target language HTTP requestcomprises: searching for a corresponding data format in the targetlanguage, and replacing the corresponding parameter string in the hostlanguage HTTP request with the parameter string corresponding to thetarget language data format. By using the corresponding parameter stringin the target language to replace the parameter string in the hostlanguage HTTP request or using the parameter string corresponding to thetarget language data format to replace the corresponding parameterstring in the host language HTTP request, a target language HTTP requestis generated.

In the following will be described the above process with reference tothe host language HTTP request given previously as an example. Accordingto an embodiment of the present invention, by analyzing the hostlanguage HTTP request, first it is determined that its language (i.e.,the host language) is en-us; further, the parameter strings appearing inthe host language HTTP request, i.e., “CreateUser” and “Jul. 11, 2011”,are extracted. Further, by checking the globalization rules, it can bedetermined that there is target language zh-cn corresponding to the hostlanguage en-us. It should be appreciated that to simplify thedescription, Table 1 only shows one target language. Table 1 may haverules corresponding to multiple target languages, and for simplicity,here corresponding examples are not given. Further, by checking theglobalization rules, it can be determined that the parameter string ofthe target language zh-cn to which the parameter string “CreateUser”corresponds is “

”. Then, the corresponding parameter string “

” of the target language (zh-cn) is used to replace the correspondingparameter string “CreatUser” in the host language HTTP request. Further,for the parameter string “Jul. 1, 2011”, by checking the globalizationrules, it can be determined that the date format of the target languagezh-ch corresponding to the date format of the host language en-us,“mm-dd-yyyy”, is “yyyy

mm

dd

”. Then the parameter string corresponding to the date format of thetarget language (zh-cn) is used to replace the corresponding parameterstring in the host language HTTP. That is, using “2011

07

01

” to replace “Jul. 1, 2011”. In the following is presented the targetlanguage HTTP request generated by the above process.

GET /SampleWeb/javax.faces.resource/sample.jsf?Stringname=%E5%88%9B%E5%BB%BA%E7%94%A8%E6%88%B7&Date=2011%E5%B9%B407%E6%9C%8801%E6%97%A 5 HTTP/1.1 Accept-Language: zh-cnUser-Agent: Mozilla/4.0 Host: 9.125.139.200 Connection: Keep-Alivewherein “%E5%88%9B%E5%BB%BA%E7%94%A8%E6%88%B7” corresponds to theencoded “□□□□”, while “2011%E5%B9%B407%E6%9C%8801%E6%97%A5” correspondsto the encoded “2011 □ 07 □ 01 □”.

Next, the method 200 enters into step 210, in which the target languagebrowser is instructed to issue the generated target language HTTPrequest; e.g., by instructing the target language browser to send thetarget language HTTP request to the target server at the target serveraddress. After the above-described step 208, one or more target languageHTTP requests have been generated from the host language HTTP requestaccording to the globalization rules. Since an HTTP request can only beissued by a browser, according to an embodiment of the presentdisclosure, respective browsers corresponding to the target languagesmay further be instructed to issue corresponding target language HTTPrequests, and further the respective browsers corresponding to thetarget languages may receive responses to the corresponding targetlanguage HTTP requests.

Next, the method 200 enters into step 212 and ends.

According to another embodiment of the present invention, the method 200for testing a browser-based application further comprises instructingthe host language browser to issue a host language HTTP request. Thisstep can be executed in response to receiving the host language HTTPrequest issued by the host language browser, or be executed in responseto generating the target language HTTP request. Instructing the hostlanguage browser to issue the host language HTTP request can be realizedby transparently processing the host language HTTP request, that is,directly sending the host language HTTP request to the host server atthe host server address without any processing. In one embodiment,sending the host language HTTP request to a host server address andsending the target language HTTP request to a target server address areperformed concurrently, for implementation of concurrent testingperformed on multiple languages versions of a Web application.

According to another embodiment of the present invention, the method 200for testing a browser-based application further comprises obtaining aresponse to the received host language HTTP request and a response tothe target language HTTP request. In response to instructing the hostlanguage browser to issue the host language HTTP request and the targetlanguage browser to issue the target language HTTP request, the hostlanguage browser will receive the response to the host language HTTPrequest and display it on the host language browser, while the targetlanguage browser will receive the response to the target language HTTPrequest and display it on the target language browser. At this time,according to an embodiment of the present disclosure, by invokinginterfaces provided by the browsers, the response to the received hostlanguage HTTP request and the response to the target language HTTPrequest can be obtained in response to the host language browser sendingthe host language HTTP request to the host server address and the targetlanguage browser sending the target language HTTP request to the targetserver address, respectively. Further, according to another embodimentof the present disclosure, the obtained response to the host languageHTTP request and response to the target language HTTP request arecompared and analyzed.

Above has been described a method for testing a browser-basedapplication according to an embodiment of the present invention withreference to an example of an HTTP GET request. It should be pointed outthat the above example is only for illustrative purpose, and should notbe construed as limitation to the technical solution of the presentdisclosure. In fact, the technical solution of the present disclosure isalso applicable to other types of HTTP request, e.g., HTTP POST, HTTPPUT, etc., which will not described here one by one.

In the following will be described a system for testing a browser-basedapplication according to an embodiment of the present invention withreference to FIG. 3.

FIG. 3 shows a block diagram of a system 300 for testing a browser-basedapplication according to an embodiment of the present invention. Asshown in FIG. 3, the system 300 for testing a browser-based applicationcomprises: a request receiver 302 configured to receive a host languageHTTP request issued by the host language browser; a rule obtainer 304configured to obtain globalization rules; a request modifier 306configured to modify the host language HTTP request according to theglobalization rules to generate a target language HTTP request; and arequest instructor 308 configured to instruct the target languagebrowser to issue the generated target language HTTP request. In thefollowing will be described the respective components in greater detail.

The request receiver 302 is configured to receive a host language HTTPrequest issued by the host language browser. The host language HTTPrequest is an HTTP request issued by the tester performing theglobalization test through the host language browser he/she operates.The host language browser can have, e.g., English interface, that is,the host language is English. The host language browser operated by thetester receives a user input and generates the host language HTTPrequest.

The rule obtainer 304 is configured to obtain globalization rules. Theglobalization rules specify the rules of correspondence betweendifferent language versions of the browser-based application.

The request modifier 306 is configured to modify the host language HTTPrequest according to the globalization rules to generate the hostlanguage HTTP request.

According to an embodiment of the present invention, the system 300 fortesting a browser-based application further comprises a parameterextractor (not shown in FIG. 3) configured to extract a parameter stringfrom the received host language HTTP request. According to an embodimentof the present invention, the request modifier 306 is further configuredto search for a corresponding parameter string in the target language,and replace the parameter string in the host language HTTP request withthe corresponding parameter string in the target language. According toan embodiment of the present invention, the request modifier 306 isfurther configured to search for a corresponding data format in thetarget language, and replace a corresponding parameter string in thehost language HTTP request with a parameter string corresponding totarget language data format. By using the corresponding parameter stringin the target language to replace the parameter string in the hostlanguage HTTP request or using the parameter string corresponding to thetarget language data format to replace a corresponding parameter stringin the host language HTTP request, a target language HTTP request isgenerated.

The request instructor 308 is configured to instruct the target languagebrowser to issue the generated target language HTTP request. Accordingto an embodiment of the present invention, the request instructor 308 isconfigured to instruct a respective browser corresponding to a targetlanguage to issue a corresponding target language HTTP request.

According to another embodiment of the present invention, the requestinstructor 308 is further configured to instruct the host languagebrowser to issue the host language HTTP request. This can be performedin response to receiving the host language HTTP request issued by thehost language browser, or performed in response to generating the hostlanguage HTTP request. This can be realized by transparently processingthe host language HTTP request, that is, the host language HTTP requestis directly sent to the server without any processing.

According to another embodiment of the present invention, the system 300for testing a browser-based application further comprises a responseobtainer (not shown in FIG. 3) configured to obtain a response to thereceived host language HTTP request and a response to the targetlanguage HTTP request. In response to instructing the host languagebrowser to issue the host language HTTP request, and the target languagebrowser to issue the target language HTTP request, the host languagebrowser will receive a response to the host language HTTP request anddisplay it on the host language browser, and the target language browserwill receive a response to the target language HTTP request and displayit on the target language browser. The response obtainer obtains theresponse to the received host language HTTP request and the response tothe target language HTTP request by invoking the interfaces provided bythe browsers. Further, according to another embodiment of the presentinvention, the system 300 for testing a browser-based applicationfurther comprises a comparison analyzer configured to compare andanalyze the response to the received host language HTTP request and theresponse to the target language HTTP request.

Above has been described the basic principles of the present inventionwith reference to specific embodiments. However, it should be pointedout that those of ordinary skills in the art can appreciate that all orany steps or components of the method and apparatus of the presentdisclosure can be realized in hardware, software or a combinationthereof in any computing devices (including processors, storage mediums,etc.) or a network of computing devices. And this can be realized bythose of ordinary skills in the art by using their basic programmingskills after reading the description of the present invention.

Therefore, the objectives of the present disclosure can be realized byrunning one program or a set of programs on any computing device. Thecomputing device can be a well-known general-purpose device. Therefore,the objectives of the present invention can also be realized by merelyproviding a program product containing the program code realizing themethod or the apparatus. That is to say, such a program product alsoforms the present invention, and the storage medium storing such aprogram product also forms the present invention. Obviously, the storagemedium can be any well-known storage medium or any storage medium to bedeveloped in the future.

It should also be pointed out that in the apparatus and method of thepresent invention, obviously the respective parts or steps may be splitand/or recombined. Such splitting and/or recombination should be viewedas equivalent solutions of the present disclosure. Moreover, the stepsof the above series of processing can be performed naturally accordingto the described sequence and in the order of time, but they are notnecessarily executed in the order of time. Some steps can be performedin parallel or independent from each other.

Although the present invention and its advantages have been described ingreat detail, it should be understood that various changes, replacementand variations can be made without departing from the sprit and scope ofthe present disclosure defined by the appended claims. Moreover, theterms, “comprise”, “include” or any other variants, in the presentapplication are intended to cover non-exclusive inclusion, so that theprocess, method, article or apparatus including a series of elements maynot only include those elements, but may also include other elements notstated explicitly, or elements inherent to the process, method, articlesor apparatus. Without more limitations, an element defined by thesentence “comprising a . . . ” does not exclude the condition that thereare other same elements in the process, method, article or apparatusincluding the element.

1. A method for testing multiple language versions of a browser-basedapplication, said method comprising: a processor of a computer systemreceiving a host language Hypertext Transfer Protocol (HTTP) requestissued by a host language browser, said host language HTTP requestconfigured to be sent to a host server address, said host language HTTPrequest comprising a plurality of parameter strings in a host language;and said processor generating a target language HTTP request byreplacing each host parameter string of at least one host parameterstring of the plurality of parameter strings in the received HTTPrequest with a respective target parameter string associated with atarget language that differs from the host language, said generatedtarget language HTTP request configured to be sent to a target serveraddress associated with and different from the host server address. 2.The method of claim 1, said method further comprising: said processorinstructing a target language browser to send the target language HTTPrequest to the target server address; and said processor instructing thehost language browser to send the host language HTTP request to the hostserver address.
 3. The method of claim 2, wherein said instructing thetarget language browser and said instructing the host language browsercomprise directing the target language browser and the host languagebrowser to concurrently send the target language HTTP request to thetarget server address and the host language HTTP request to the hostserver address.
 4. The method of claim 2, said method furthercomprising: said processor obtaining a response to the host languageHTTP request in response to said host language browser sending the hostlanguage HTTP request to the host server address; said processorobtaining a response to the target language HTTP request in response tosaid target language browser sending the target language HTTP request tothe target server address; said processor comparing and analyzing theobtained response to the host language HTTP request and the obtainedresponse to the target language HTTP request.
 5. The method of claim 1,wherein said generating the target language HTTP request comprises:obtaining globalization rules of correspondence between host parameterstrings in the host language and corresponding target parameter stringsassociated with the target language; finding in the globalization rules:each host parameter string of the at least one host parameter string inthe host language HTTP request; determining from the globalizationrules: the respective target parameter string corresponding to each hostparameter string found, via said finding, in the globalization rules;and replacing each host parameter string of the at least one hostparameter string in the host language HTTP request with the respectivetarget parameter string determined from the globalization rules.
 6. Themethod of claim 5, wherein a host address parameter string of the atleast one host parameter string in the host language HTTP request is thehost server address, and wherein the globalization rules specify thatthe target server address is the respective target parameter stringcorresponding to the host address parameter string.
 7. The method ofclaim 5, wherein a date format parameter string of the at least one hostparameter string in the host language HTTP request specifies a formatfor a month, day, and year of a date.
 8. The method of claim 5, whereina host language parameter string of the at least one host parameterstring in the host language HTTP request is the host language, andwherein the globalization rules specify that the target language is therespective target parameter string corresponding to the host languageparameter string.
 9. The method of claim 5, wherein the at least onehost parameter string in the host language HTTP request comprises atleast two host parameter strings, wherein a table comprises theglobalization rules, wherein one column of the table comprises adifferent host parameter string of the at least two host parameterstrings in different rows of the table, and wherein another column ofthe table comprises the target parameter string corresponding to thedifferent host parameter string in the different rows of the table. 10.The method of claim 1, wherein the host language is English, and whereinthe target language is Chinese.